<?php

/**
 * ContactStudent form base class.
 *
 * @method ContactStudent getObject() Returns the current form's model object
 *
 * @package    ecollegeplus
 * @subpackage form
 * @author     Batanayi Matuku
 * @version    SVN: $Id: sfDoctrineFormGeneratedInheritanceTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseContactStudentForm extends ContactForm
{
  protected function setupInheritance()
  {
    parent::setupInheritance();

    $this->widgetSchema   ['student_id'] = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Student'), 'add_empty' => false));
    $this->validatorSchema['student_id'] = new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Student')));

    $this->widgetSchema   ['postal_address_line_1'] = new sfWidgetFormTextarea();
    $this->validatorSchema['postal_address_line_1'] = new sfValidatorString(array('max_length' => 300));

    $this->widgetSchema   ['postal_address_line_2'] = new sfWidgetFormTextarea();
    $this->validatorSchema['postal_address_line_2'] = new sfValidatorString(array('max_length' => 300, 'required' => false));

    $this->widgetSchema   ['postal_postcode'] = new sfWidgetFormInputText();
    $this->validatorSchema['postal_postcode'] = new sfValidatorString(array('max_length' => 10, 'required' => false));

    $this->widgetSchema   ['postal_city'] = new sfWidgetFormInputText();
    $this->validatorSchema['postal_city'] = new sfValidatorString(array('max_length' => 255, 'required' => false));

    $this->widgetSchema   ['postal_country_id'] = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('PostalCountry'), 'add_empty' => false));
    $this->validatorSchema['postal_country_id'] = new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('PostalCountry')));

    $this->widgetSchema   ['postal_state_province_id'] = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('PostalStateProvince'), 'add_empty' => false));
    $this->validatorSchema['postal_state_province_id'] = new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('PostalStateProvince')));

    $this->widgetSchema   ['guardian_first_name'] = new sfWidgetFormInputText();
    $this->validatorSchema['guardian_first_name'] = new sfValidatorString(array('max_length' => 255, 'required' => false));

    $this->widgetSchema   ['guardian_last_name'] = new sfWidgetFormInputText();
    $this->validatorSchema['guardian_last_name'] = new sfValidatorString(array('max_length' => 255, 'required' => false));

    $this->widgetSchema   ['guardian_email_address'] = new sfWidgetFormInputText();
    $this->validatorSchema['guardian_email_address'] = new sfValidatorString(array('max_length' => 255, 'required' => false));

    $this->widgetSchema   ['guardian_phone_work'] = new sfWidgetFormInputText();
    $this->validatorSchema['guardian_phone_work'] = new sfValidatorString(array('max_length' => 200, 'required' => false));

    $this->widgetSchema   ['guardian_phone_home'] = new sfWidgetFormInputText();
    $this->validatorSchema['guardian_phone_home'] = new sfValidatorString(array('max_length' => 200, 'required' => false));

    $this->widgetSchema   ['guardian_phone_mobile'] = new sfWidgetFormInputText();
    $this->validatorSchema['guardian_phone_mobile'] = new sfValidatorString(array('max_length' => 200, 'required' => false));

    $this->widgetSchema   ['guardian_address_line_1'] = new sfWidgetFormTextarea();
    $this->validatorSchema['guardian_address_line_1'] = new sfValidatorString(array('max_length' => 300, 'required' => false));

    $this->widgetSchema   ['guardian_address_line_2'] = new sfWidgetFormTextarea();
    $this->validatorSchema['guardian_address_line_2'] = new sfValidatorString(array('max_length' => 300, 'required' => false));

    $this->widgetSchema   ['guardian_postcode'] = new sfWidgetFormInputText();
    $this->validatorSchema['guardian_postcode'] = new sfValidatorString(array('max_length' => 10, 'required' => false));

    $this->widgetSchema   ['guardian_city'] = new sfWidgetFormInputText();
    $this->validatorSchema['guardian_city'] = new sfValidatorString(array('max_length' => 255, 'required' => false));

    $this->widgetSchema   ['guardian_country_id'] = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GuardianCountry'), 'add_empty' => true));
    $this->validatorSchema['guardian_country_id'] = new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('GuardianCountry'), 'required' => false));

    $this->widgetSchema   ['guardian_state_province_id'] = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GuardianStateProvince'), 'add_empty' => true));
    $this->validatorSchema['guardian_state_province_id'] = new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('GuardianStateProvince'), 'required' => false));

    $this->widgetSchema->setNameFormat('contact_student[%s]');
  }

  public function getModelName()
  {
    return 'ContactStudent';
  }

}
